<?php
/**
 * Extended Config class to get config by global APPLICATION_ENVIRONMENT
 * constant
 *
 * @author Lukas Normantas
 */
class Areal_Config extends Zend_Config_Xml
{
    /**
     * Singleton instance
     *
     * Marked only as protected to allow extension of the class. To extend,
     * simply override {@link getInstance()}.
     *
     * @var Areal_Config
     */
    protected static $_instance = null;

    function __construct()
    {
        parent::__construct( BASE_PATH . 'config.xml', APPLICATION_ENVIRONMENT ,
        array('allowModifications'=>true));
    }
    
    /**
     * Singleton instance
     *
     * @return Areal_Config
     */
    public static function getInstance()
    {
        if (null === self::$_instance) {
            $front = new Areal_Config();
            self::$_instance = $front; 
        }
        return self::$_instance;
    }      
}